package cn.itheima.clients;

import cn.itheima.config.FeignConfig;
import cn.itheima.pojo.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author : itheima
 * @date : 2023/6/6 11:26
 * @description :
 */
@FeignClient(value = "userservice",configuration ={FeignConfig.class} )// 与mybatis类似，底层基于jdk动态代理实现
//@RequestMapping("/user")//可以，但是一般fiegn接口能聚合了某一类资源访问接口，可能来自不同的controller类
public interface UserClient {
    @GetMapping("/user/{id}")
    public User queryById(@PathVariable("id") Long id);

    @GetMapping("/user/getUserInfo")
    public String getUserInfo(@RequestParam String userName,@RequestParam Integer age);
}
